*/ public function register(): array { return [ T_TRAIT, ]; } /** * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint * @param int $traitPointer */ public function process(File $phpcsFile, $traitPointer): void { $traitName = ClassHelper::getName($phpcsFile, $traitPointer); $this->checkSuffix($phpcsFile, $traitPointer, $traitName); } private function checkSuffix(File $phpcsFile, int $traitPointer, string $traitName): void { $suffix = substr($traitName, -5); if (strtolower($suffix) !== 'trait') { return; } $phpcsFile->addError(sprintf('Superfluous suffix "%s".', $suffix), $traitPointer, self::CODE_SUPERFLUOUS_SUFFIX); } }